﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using log4net;
using System.Reflection;
using DrugStore.FormCollect;

namespace DrugStore
{
    static class Program
    {
        private static log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            log.Info("App start");

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            log4net.Config.XmlConfigurator.Configure();
            Application.Run(new LogOn());
            if (LogOn.LoggedOn && LogOn.UserRole==1)
            {
                Application.Run(new MainFormAdmin());
            }
            else if (LogOn.LoggedOn && LogOn.UserRole == 2)
            {
                Application.Run(new MainFormBanHang());
            }
            else if (LogOn.LoggedOn && LogOn.UserRole == 3)
            {
                Application.Run(new MainFormNhapHang());
            }
            else if (LogOn.LoggedOn && LogOn.UserRole == 4)
            {
                Application.Run(new MainFormKhamBenh());
            }
            else
            {
                
            }
            
        }
    }
}
